import abs from './absrightmenuitemaction.js'
// import axios from 'axios'


class MakeSymbolAction extends abs.IRightMenuItemAction {
  constructor(map,subItem) {
    super(map);
    this.subItem = subItem;
  }

  act2Click(evt) {
    switch (this.subItem){
      case "makeSymbol":
        this.openSymbolDefDlg();
        break;

      case "generateIcon2Local":
        this.generateIcon2Local();
        break;

      default:
        break;
    }
  }

  generateIcon2Local(){
    this.mapctrl.m_pSymbolINTF.generateICON_local();
  }

  openSymbolDefDlg() {
    let t = window.symbolDefDlg.value;
    if (t && !t.visible) {
      t.visible = true;
      t.mapctrl = this.mapctrl;
    }
  }
}

export default { MakeSymbolAction }